#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.api.config.logbook;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.zalando.logbook.Correlation;
import org.zalando.logbook.HttpLogWriter;
import org.zalando.logbook.Precorrelation;

/**
 * @author qingchang.tang
 * @date 2020/3/29 12:12
 */
@Component
@Slf4j
public class CustomHttpLogWriter implements HttpLogWriter {

    @Override
    public boolean isActive() {
        return true;
    }

    @Override
    public void write(Precorrelation precorrelation, String request) {
        log.info("HTTP_REQUEST: {}", request);
    }

    @Override
    public void write(Correlation correlation, String response) {
        log.info("HTTP_RESPONSE: {}", response);
    }
}
